home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_gen_bubblegen.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
3KB
|
113 lines
# Jones 3D Cog Script
#
# GEN_BubbleGen.cog
#
# Attach to a ghost object.
# single=1: single bubble stream
# single=0: multiple, wide patern (x=2.5m, y=0.5m)
# bub_Life: amount of time before bubbles completely fade out.
#
# [TRM]
#
# (C) 1999 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================
symbols
message sighted
message timer
thing origin # Where the bubbles are coming from
thing bubble local
thing player local
template bubble0=+bubbles local
template bubble1=+bubbles local
template bubble2=+bubbles local
vector startBubble local
vector finBubble local
vector bubbleVel local
vector vecPos local
int single=0 # 1 = single bubble stream, 0 = multiple random stream
int i=0 local
int blurps=3 local
flex bub_Life=2.0
end
# ========================================================================================
code
sighted:
player = GetLocalPlayerThing();
Sleep(0.01);
Print("sighted");
if(HasLOS(player, origin))
{
SetTimer(1.0);
}
return;
# ========================================================================================
timer:
if(single == 1)
{
for(i=0; i<blurps; i=i+1)
{
bubble = CreateThing(bubble0[RandBetween(0,2)], origin);
bubbleVel = VectorSet(0,0,rand()+0.25);
SetThingVel(bubble, VectorScale(bubblevel, 0.2));
startBubble = VectorSet(0.01, 0.01, 1.0);
finBubble = VectorSet(0.05, 0.05, 0.0);
AnimateSpriteSize(bubble, startBubble, finBubble, bub_Life);
}
i = 0;
}
if(single == 0)
{
for(i=0; i<blurps; i=i+1)
{
vecPos = VectorSet(rand()*0.25, rand()*0.05, 0);
bubble = CreateThingAtPos(bubble0[RandBetween(0,2)], GetThingSector(origin), VectorAdd(GetThingPos(origin), vecPos), '0 0 0');
bubbleVel = VectorSet(0,0,rand()+0.25);
SetThingVel(bubble, VectorScale(bubblevel, 0.2));
startBubble = VectorSet(0.01, 0.01, 1.0);
finBubble = VectorSet(0.05, 0.05, 0.0);
AnimateSpriteSize(bubble, startBubble, finBubble, bub_Life);
}
i = 0;
}
if(HasLOS(player, origin))
{
SetTimer(1.0);
}
if(!HasLOS(player, origin))
{
Print("no LOS");
ClearThingFlags(origin, 0x100000); # mark thing as unseen
}
return;
# ========================================================================================
end